package com.example.easyexcel.enums;

import lombok.Data;

/**
 * @author dangwen1
 * @date 2021年12月02日 20:24
 * @description
 */

public enum UserStatusEnum {
    EFFECT(1, "有效");

    private Integer code;
    private String desc;

    UserStatusEnum(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getCode() {
        return code;
    }

    public static UserStatusEnum getByDesc(String desc){
        for (UserStatusEnum value : UserStatusEnum.values()) {
            if (value.getDesc().equals(desc)){
                return value;
            }
        }
        return null;
    }
}
